# -*- coding: utf-8 -*-
"""
Module Description: 适配器基础配置文件
Date: 2017/05/10
Author:MinRui
"""

# 角色数据表的业务锁定义
# 为了避免因为业务不同而使用不同粒度的锁,这里为每张需要加锁的表定义了统一的粒度
# 当对某张表的数据进行加锁时,需要传入对应的所有字段参数.即 TbXXXAdapter.lock(a=?, b=?)
# 详见 app.dbsync.dal_adapters.base.py::BaseAdapter::lock()
lock_cfg = {
    'TbMinister': ('RoleGuid',),
    'TbRole': ('RoleGuid',),
    'TbRoleDrillStatus': ('RoleGuid',),
    'TbDrillBattleRecord': ('AtkRid', 'DefRid'),
    'TbPrinceMarryScore': ('RoleGuid',),
    'TbPrinceAskSeek': ('PrinceId',),
    'TbPrince': ('Id',),
    'TbAllianceMember': ('RoleGuid',),
    'TbAlliance': ('Id',),
    'TbAllianceApply': ('Id',),
    'TbAllianceMystery': ('AllianceId', 'MysteryLv',),
    'TbAllianceMysteryPoint': ('AllianceId', 'MysteryLv', 'PointId',),
    'TbAllianceRankActivityRecord': ('ActivityId', 'AllianceId',),
    'TbRankAllianceMemberRecord': ('RoleGuid',),
    'TbTitle': ('TitleId',),
    'TbRankActivity': ('ActivityId',),
    'TbItem': ('ItemType', 'ItemId',),
    'TbServerInfo': ('EnvKey',),
    'TbAllianceBattleMatch': ('ActivityId', 'AllianceId',),
    'TbAllianceBattleDispatch': ('ActivityId', 'AllianceId', 'BattleshipType',),
    'TbAllianceSiegeActivity': ('ActivityId',),
    'TbImperialGarden': ('TableNum',),
    'TbRoleImperialGarden': ('TableId',),
    'TbWelfareActivityRecord': ('RoleGuid', 'ActivityId',),
    'TbPayRecord': ('OrderId',),
    'TbConcubine': ('RoleGuid', 'CfgId',),
    'TbMinisterGroup': ('RoleGuid', 'GroupId',),
    'TbConcubineStrengthen': ('RoleGuid', 'ConcubineId',),
    'TbRoleBuff': ('RoleGuid', 'BuffType',),
    'TbRoleCostume': ('RoleGuid', 'CostumeId',),
    'TbRoleReusableActivity': ('RoleGuid', 'ActivityType', 'ActivityId',),
    'TbRoleHunt': ('RoleGuid',),
    'TbMinistryOfForeignAffairs': ('RoleGuid',),
    'TbDinnerRole': ('RoleGuid',),


    'TbCrossRuinsRole': ('RoleGuid',),
    'TbCrossPrinceMarryAskSeek': ('PrinceId',),
    'TbCrossPrinceMarrySeekPool': ('PrinceId',),
    'TbCrossChessTeam': ('TeamId',),
    'TbCrossChessRole': ('ActivityId', 'RoleGuid',),
    'TbCrossChessMark': ('TeamId', 'MarkRid'),
    'TbCrossChessAffair': ('AffairId', ),
    'TbCrossContendAcademy': ('ActivityId', 'AcademyType', 'AcademyId'),
    'TbCrossContendRole': ('ActivityId', 'RoleGuid'),
    'TbCrossSoccerRole': ('ActivityId', 'RoleGuid',),
    'TbCrossAlliesCountry': ('AlliesId', 'CountryId',),
    'TbCrossAlliesTipsRole': ('RoleGuid',),
    'TbCrossAlliesRole': ('AlliesId', 'RoleGuid',),
    'TbCrossAlliesCountryApply': ('AlliesId', 'RoleGuid',),
    'TbCrossAlliesCampaignRole': ('AlliesId', 'RoleGuid',),
    'TbCrossIslandTreasureAffair': ('ActivityId', 'AffairId',),
    'TbCrossIslandRole': ('AlliesId', 'CountryId',),
    'TbCrossIslandAchieveAllies': ('ActivityId', 'AlliesId', 'CountryId', 'TaskType',),
    'TbCrossMonopolyAllianceAchievement': ('ActivityId', 'AllianceId', 'TaskType'),
    'TbCrossMonopolyAllianceBuff': ('ActivityId', 'AllianceId', 'BuffId'),
    'TbCrossMonopolyPersonAchievement': ('ActivityId', 'RoleGuid', 'TaskType'),

    'TbCrossSiegelordAchieveAllies': ('FieldId', 'AlliesId', 'CountryId', 'TaskType'),
    'TbCrossCeladonRole': ('RoleGuid', ),
    'TbCrossCeladonAlliesBattle': ('BattleId', ),
    'TbPuzzleFragmentChange': ("ChangeId", )
}
